package com.qinge.blog.utils.result;

import com.qinge.blog.utils.result.JsonResult;
import com.qinge.blog.utils.result.ResultCode;

/**
 * @author QDW
 * @date 2022/4/29 11:02
 * @description ResultTool
 **/
public class ResultTool {
    public static JsonResult success() {
        return new JsonResult(true);
    }

    public static <T> JsonResult<T> success(T data) {
        return new JsonResult(true, data);
    }

    public static JsonResult fail() {
        return new JsonResult(false);
    }

    public static JsonResult fail(ResultCode resultEnum) {
        return new JsonResult(false, resultEnum);
    }
}
